initial port for Cevo game in C++ (libs)
This commit is contained in:
commit
8436242032
375 files changed
+46282
No files matched your search
@@ -0,0 +1,65 @@
|
||||
#include "Dpi/DpiComCtrls.h"
|
||||
|
||||
#include <QHeaderView>
|
||||
|
||||
namespace Dpi {
|
||||
|
||||
ListView::ListView(QWidget *parent) : QTreeWidget(parent)
|
||||
{
|
||||
setRootIsDecorated(false);
|
||||
connect(header(), &QHeaderView::sectionClicked, this, &ListView::columnClicked);
|
||||
connect(this, &QTreeWidget::itemSelectionChanged, this, &ListView::selectionChanged);
|
||||
}
|
||||
|
||||
void ListView::setViewStyle(ViewStyle value)
|
||||
{
|
||||
m_viewStyle = value;
|
||||
switch (value) {
|
||||
case ViewStyle::Report:
|
||||
setHeaderHidden(false);
|
||||
setIndentation(0);
|
||||
break;
|
||||
case ViewStyle::List:
|
||||
case ViewStyle::SmallIcon:
|
||||
case ViewStyle::Icon:
|
||||
setHeaderHidden(true);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
void ListView::setCheckboxes(bool value)
|
||||
{
|
||||
m_checkboxes = value;
|
||||
for (int i = 0; i < topLevelItemCount(); ++i) {
|
||||
QTreeWidgetItem *it = topLevelItem(i);
|
||||
it->setFlags(value ? (it->flags() | Qt::ItemIsUserCheckable)
|
||||
: (it->flags() & ~Qt::ItemIsUserCheckable));
|
||||
}
|
||||
}
|
||||
|
||||
ToolBar::ToolBar(QWidget *parent) : QToolBar(parent) {}
|
||||
|
||||
int ToolBar::buttonHeight() const { return iconSize().height(); }
|
||||
void ToolBar::setButtonHeight(int value) { setIconSize(QSize(iconSize().width(), value)); }
|
||||
int ToolBar::buttonWidth() const { return iconSize().width(); }
|
||||
void ToolBar::setButtonWidth(int value) { setIconSize(QSize(value, iconSize().height())); }
|
||||
|
||||
CoolBar::CoolBar(QWidget *parent) : QSplitter(Qt::Horizontal, parent)
|
||||
{
|
||||
setChildrenCollapsible(false);
|
||||
}
|
||||
|
||||
void CoolBar::addBand(const CoolBand &band)
|
||||
{
|
||||
if (!band.widget)
|
||||
return;
|
||||
band.widget->setMinimumSize(band.minWidth, band.minHeight);
|
||||
addWidget(band.widget);
|
||||
}
|
||||
|
||||
void CoolBar::beginUpdate() { setUpdatesEnabled(false); }
|
||||
void CoolBar::endUpdate() { setUpdatesEnabled(true); }
|
||||
|
||||
PageControl::PageControl(QWidget *parent) : QTabWidget(parent) {}
|
||||
|
||||
} // namespace Dpi
|
||||
Reference in new issue
Block a user