void HClientFiles::setConnectionName(QString conn) { sConn = conn; db=QSqlDatabase::database(sConn); setupForm(); }
HLotti::HLotti(QWidget *parent,HUser *puser,QString pcon) : QWidget(parent), ui(new Ui::HLotti) { user=puser; sConnection=pcon; ui->setupUi(this); //setWindowModality(Qt::ApplicationModal); this->setContextMenuPolicy(Qt::CustomContextMenu); setupForm(); }
ListItemSettingsEditor::ListItemSettingsEditor(QWidget *parent) : QWidget(parent), ui(new Ui::ListItemSettingsForm), m_listitem(new QtMaterialListItem()) { m_listitem->setLetter( QString("This is the first, image+icon+text, lineitem. I want the string to be longer and longer to test clipping." )); m_listitem->setIcon(QtMaterialTheme::icon("communication", "message")); m_listitem->setImage(QImage(":/images/assets/sikh.jpg")); QVBoxLayout *layout = new QVBoxLayout; setLayout(layout); QWidget *widget = new QWidget; layout->addWidget(widget); QWidget *canvas = new QWidget; canvas->setStyleSheet("QWidget { background: white; }"); layout->addWidget(canvas); ui->setupUi(widget); layout->setContentsMargins(20, 20, 20, 20); QtMaterialListItem *m_listitem2 = new QtMaterialListItem; m_listitem2->setLetter( QString("This is the second, icon+text, lineitem. I want the string to be longer and longer to test clipping." )); m_listitem2->setIcon(QtMaterialTheme::icon("communication", "message")); QtMaterialListItem *m_listitem3 = new QtMaterialListItem; m_listitem3->setLetter( QString("This is the third, text only, lineitem. I want the string to be longer and longer to test clipping." )); // m_listitem2->setImage(QImage(":/images/assets/sikh.jpg")); layout = new QVBoxLayout; layout->setContentsMargins(0, 0, 0, 0); layout->setSpacing(0); canvas->setLayout(layout); layout->addWidget(m_listitem); layout->addWidget(m_listitem2); layout->addWidget(m_listitem3); // layout->setAlignment(m_listitem, Qt::AlignCenter); layout->addStretch(); setupForm(); connect(ui->disabledCheckBox, SIGNAL(toggled(bool)), this, SLOT(updateWidget())); connect(ui->useThemeColorsCheckBox, SIGNAL(toggled(bool)), this, SLOT(updateWidget())); connect(ui->sizeSpinBox, SIGNAL(valueChanged(int)), this, SLOT(updateWidget())); connect(ui->typeComboBox, SIGNAL(currentIndexChanged(int)), this, SLOT(updateWidget())); connect(ui->backgroundColorToolButton, SIGNAL(pressed()), this, SLOT(selectColor())); connect(ui->textColorToolButton, SIGNAL(pressed()), this, SLOT(selectColor())); ui->sizeSpinBox->setRange(5, 300); }
void ListItemSettingsEditor::selectColor() { QColorDialog dialog; if (dialog.exec()) { QColor color = dialog.selectedColor(); QString senderName = sender()->objectName(); if ("textColorToolButton" == senderName) { m_listitem->setTextColor(color); ui->textColorLineEdit->setText(color.name(QColor::HexRgb)); } else if ("backgroundColorToolButton" == senderName) { m_listitem->setBackgroundColor(color); ui->backgroundColorLineEdit->setText(color.name(QColor::HexRgb)); } } setupForm(); }
ScrollBarSettingsEditor::ScrollBarSettingsEditor(QWidget *parent) : QWidget(parent), ui(new Ui::ScrollBarSettingsForm), m_verticalScrollbar(new QtMaterialScrollBar), m_horizontalScrollbar(new QtMaterialScrollBar) { QVBoxLayout *layout = new QVBoxLayout; setLayout(layout); QWidget *widget = new QWidget; layout->addWidget(widget); QWidget *canvas = new QWidget; canvas->setStyleSheet("QWidget { background: white; }"); layout->addWidget(canvas); ui->setupUi(widget); layout->setContentsMargins(20, 20, 20, 20); layout = new QVBoxLayout; canvas->setLayout(layout); canvas->setMaximumHeight(400); QTextEdit *edit = new QTextEdit; edit->setText("<p>The distinction between the subjects of syntax and semantics has its origin in the study of natural languages.</p><p>The distinction between the subjects of syntax and semantics has its origin in the study of natural languages.</p><p>The distinction between the subjects of syntax and semantics has its origin in the study of natural languages.</p><p>The distinction between the subjects of syntax and semantics has its origin in the study of natural languages.</p><p>The distinction between the subjects of syntax and semantics has its origin in the study of natural languages.</p><p>The distinction between the subjects of syntax and semantics has its origin in the study of natural languages.</p><p>The distinction between the subjects of syntax and semantics has its origin in the study of natural languages.</p><p>The distinction between the subjects of syntax and semantics has its origin in the study of natural languages.</p>"); edit->setLineWrapMode(QTextEdit::NoWrap); edit->update(); edit->setMaximumHeight(200); edit->setVerticalScrollBar(m_verticalScrollbar); edit->setHorizontalScrollBar(m_horizontalScrollbar); //m_verticalScrollbar->setHideOnMouseOut(false); //m_horizontalScrollbar->setHideOnMouseOut(false); m_horizontalScrollbar->setOrientation(Qt::Horizontal); layout->addWidget(edit); layout->setAlignment(edit, Qt::AlignHCenter); setupForm(); }
FormTournament::FormTournament(QWidget *parent) : FormBase(parent, "FormTournament") { setupForm(); this->setupButtons(FormBase::AcceptButton, FormBase::CancelButton); }